<?php
declare (strict_types = 1);

namespace app\api\validate;

use think\Validate;

class User extends Validate
{
    protected $rule =   [
        'username'  => 'require|unique:users',
        'phone' => 'require|mobile',	
    ];
    
    protected $message  =   [
        'username.require' => '用户名不能为空',
        'username.unique' => '该用户名已经存在',
        'phone.require' => '手机号不能为空',
        'phone.mobile' => '手机号格式不正确'
    ];

    protected $scene = [
        'search'  =>  ['name']
    ];  

}
